package com.demo;

class Stu {
    public int age;
}

public class Demo2 {
    public static void main(String[] args) throws InterruptedException {
        Stu stu = new Stu();
        Thread t1 = new Thread(() -> {
            stu.age+= 3;
            System.out.println(stu.age);
        });
        Thread t2 = new Thread(() -> {
            stu.age+= 2;
            System.out.println(stu.age);
        });
        t1.start();

        t2.setPriority(10);
        t2.start();
        Thread.sleep(3000);
        System.out.println(stu.age);
    }
}
